﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IrisGenerator.Framework.Messaging;

namespace IrisGenerator.Common.Core
{
    public abstract class BindableObject<T>:IBindableObject,IMessageSender<T>
    {

        #region IBindableObject<T> Members

        public abstract void Insert();
        public virtual bool Delete()
        {
            return this.Delete(false);
        }
        public abstract bool Delete(bool fireRuleMessages);
        public abstract void Update();

        public object col { get; set; }
        #endregion


        #region IMessageSender<T> Members

        public event EventHandler<MessageEventArgs<T>> MessageSend;

        protected void OnMessageSend(MessageEventArgs<T> e)
        {
            if (MessageSend != null)
                MessageSend(this, e);
        }

        #endregion
    }
}
